{% extends 'base/layout.html' %}

{% block title %}{{ _('Wiki') }} - {{ sitename }}{% endblock %}

{% block extrahead -%}
        {{ super() }}
        <link rel="stylesheet" type="text/css" href="/static/styles/wiki.css">
{%- endblock %}

{% block body_id %}wiki{% endblock %}

{% block sidebar_1 %}
    {% if current_endpoint == 'wiki/index' %}
        {% if revision.toc %}
        <h4>{{ _('Table of contents') }}</h4>
        {{ revision.toc|safe }}
        {% endif %}

        <h4>{{ _('This page') }}</h4>
        <ul>
            <li><a href="{{ url_for('wiki/edit', page_path=page_path, version=version) }}" title="{{ _('Edit this page') }}">{{ _('Edit') }}</a></li>
            {% if revision %}
            <li>
                <a href="{{ url_for('wiki/changes', page_path=page_path) }}" title="{{ _('Change history for this page') }}">{{ _('History') }}</a>
                | <a href="{{ url_for('wiki/changes-atom', page_path=page_path) }}" title="{{ _('Atom feed for changes in this page') }}">{{ _('Feed') }}</a>
            </li>
            {% endif %}
        </ul>
    {% endif %}

    <h4>{{ _('This wiki') }}</h4>
    <ul>
        <li>
            <a href="{{ url_for('wiki/list') }}" title="{{ _('List of all pages') }}">{{ _('All pages') }}</a>
            | <a href="{{ url_for('wiki/list-atom') }}" title="{{ _('Atom feed for list of pages') }}">{{ _('Feed') }}</a>
        </li>
        <li>
            <a href="{{ url_for('wiki/changes') }}" title="{{ _('List of all latest changes') }}">{{ _('Latest changes') }}</a>
            | <a href="{{ url_for('wiki/changes-atom') }}" title="{{ _('Atom feed for latest changes') }}">{{ _('Feed') }}</a>
        </li>
    </ul>
{% endblock %}

{% block extrabody %}
    {{ super() }}
    <script src="/static/scripts/wiki.js"></script>
{% endblock %}
